package com.wy.self;

import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;

import com.wy.base.AbstractWizardPage;

/**
 * 自定义模板页面展示类
 *
 * @author 飞花梦影
 * @date 2021-07-19 14:03:13
 * @git {@link https://github.com/dreamFlyingFlower }
 */
public class SelfWizardPage extends AbstractWizardPage {

	public Boolean isMavenType;

	public Button maven;

	public Button none;

	/** 自定义页面名称,只能放在resources/_templates下 */
	private Text templalteText;

	protected SelfWizardPage(ISelection selection) {
		super("wizardPage");
		setTitle("Spring Self Wizard");
		setDescription("Spring Self Class Definition");
		this.selection = selection;
	}

	@Override
	public void additionalControl(Composite parent, Composite self) {
		new Label(self, 0);
		Label label = new Label(self, SWT.NULL);
		label.setText("&Project Type:");
		none = new Button(self, SWT.RADIO);
		none.setText("None");
		maven = new Button(self, SWT.RADIO);
		maven.setText("Maven");
		maven.setSelection(true);
		new Label(self, 0);
	}

	public Boolean getIsMavenType() {
		if (maven.getSelection()) {
			isMavenType = true;
		}
		return isMavenType;
	}

	public Boolean getIsNone() {
		return none.getSelection();
	}

	public Text getTemplalteText() {
		return templalteText;
	}

	public void setTemplalteText(Text templalteText) {
		this.templalteText = templalteText;
	}
}